package com.example.stujava.module.xiangxue.generic.employee;

public class Pair<T> {
    private T one;
    private T two;

    public T getOne() {
        return one;
    }

    public void setOne(T one) {
        this.one = one;
    }

    public T getTwo() {
        return two;
    }

    public void setTwo(T two) {
        this.two = two;
    }

    /**
     * 静态泛型方法
     *
     * @param pair
     * @param <T>
     */
    public static <T> void set(Pair<Worker> pair) {

    }

    /**
     * 静态内部类
     * @param <T>
     */
    private static class ExtendPair<T> extends Pair<T> {

    }

    private static class EmployeePair extends Pair<Employee> {

    }

    public static void main(String[] args) {
        //1. employPair 和 worker 泛型参数没有继承关系
        Pair<Employee> employeePair = new Pair<>();
        Pair<Worker> workerPair = new Pair<>();
        //2. 泛型类可以继承或扩展其他泛型类，比如List和ArrayList
        Pair<Employee> employeePair2 = new ExtendPair<>();

    }
}
